package cn.com.scitc.user;

import cn.com.scitc.dao.ManagerDao;
import cn.com.scitc.model.Manager;

import javax.servlet.ServletException;
import javax.servlet.annotation.WebServlet;
import javax.servlet.http.HttpServlet;
import javax.servlet.http.HttpServletRequest;
import javax.servlet.http.HttpServletResponse;
import java.io.IOException;
import java.util.List;

@WebServlet(name = "UserListServlet",urlPatterns = "/manager/user/list")
public class UserListServlet extends HttpServlet {

    protected void doGet(HttpServletRequest request, HttpServletResponse response) throws ServletException, IOException {
        final ManagerDao managerDao = new ManagerDao();
        final List<Manager> managers = managerDao.selectAll();
        request.setAttribute("managers",managers);

        request.getRequestDispatcher("/WEB-INF/manager/user/list.jsp").forward(request,response);
    }
}
